NexusPi Git Node
Commit ca45b067666a7bc4d5628132b3d0907f4d2637da
Parents : 37f29ee
Author : copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-04-25T00:35:57Z
Committer : GitHub <noreply@github.com>
Date : 2026-04-25T00:35:57Z
Address review feedback: isinf check + sizeof(double) static_assert
Agent-Logs-Url: https://github.com/jrl290/RTNode-HeltecV4/sessions/2b277a15-6296-4a53-ae43-87d092e85f09
Co-authored-by: jrl290 <1811031+jrl290@users.noreply.github.com>
Changes
Diff
diff --git a/Advertise.h b/Advertise.h
index 0974332..b26d537 100644
--- a/Advertise.h
+++ b/Advertise.h
@@ -194,6 +194,7 @@ static inline void adv_mp_bin(RNS::Bytes& out, const uint8_t* p, size_t len) {
// IEEE-754 binary64, big-endian (msgpack float64, prefix 0xcb).
static inline void adv_mp_float64(RNS::Bytes& out, double v) {
+ static_assert(sizeof(double) == 8, "msgpack float64 requires IEEE-754 binary64");
uint8_t buf[8];
memcpy(buf, &v, 8);
// Detect host endianness — virtually always little-endian on ESP32.
diff --git a/BoundaryMode.h b/BoundaryMode.h
index 81cc8db..df42fd8 100755
--- a/BoundaryMode.h
+++ b/BoundaryMode.h
@@ -189,8 +189,9 @@ inline bool boundary_read_double(int addr, double& out) {
}
if (all_ff) return false;
memcpy(&out, buf, sizeof(out));
- // Reject NaN / inf values that may slip in from corrupted EEPROM.
- if (isnan(out) || out > 1e9 || out < -1e9) return false;
+ // Reject NaN / inf values that may slip in from corrupted EEPROM. Range
+ // clamping for valid-but-out-of-range coordinates happens at the call site.
+ if (isnan(out) || isinf(out)) return false;
return true;
}
Served by rngit 1.4.2 - Generated in 0.02s